package sql;

/**
 * @classname:UserSql
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/30 22:45
 * @version: 0.1
 * @since:1.8
 */
public interface UserSql {
    //接口的变量是常量
    String INSERT_USER = "insert into tb_userinfo(name,age,pass,balance,image,birthday,roleid,status) value (?,?,?,?,?,?,?,?);";
    String DELETE_USER_BYID = "delete from tb_userinfo where id=?";
    String SELECT_USER_BYID ="select * from tb_userinfo where id=?";
    String SELECT_USER_ALL = "select * from tb_userinfo";
    String UPDATA_USER = "update tb_userinfo set name =?,age=?,pass=?,balance=?,image=?,birthday=?,roleid=?,status=? where id=?";
    String SELECT_ROLE_PER ="select\n" +
            "    u.id,u.name,u.age,u.image,r.rolename,rp.pid,p.path\n" +
            "  from tb_userinfo as u,tb_role as r,tb_role_per as rp,tb_permission as p\n" +
            "  where u.id=? and u.roleid=r.id and r.id=rp.roleid and rp.pid=p.id;";
    String INSERT_ROLR ="inset into tb_role rolename=?,roledesc=? ";
}
